#!/usr/bin/env python

import wx

import widget as w
import widget.toolBar as t
import resource.string.menu.image.post as rPost
import resource.string.menu.file as rFile
import resource.string.menu.help as rHelp
import resource.toolbar as rTool

class ToolBar(wx.ToolBar):
    '''ToolBar class
    
    @author Julot <andy.julot@gmail.com>
    @since Thursday, February 02, 2012. 11:00 PM'''
    
    def __init__(self, parent):
        style = wx.TB_HORIZONTAL | wx.TB_FLAT
        super(ToolBar, self).__init__(parent, style=style)
        self.SetToolBitmapSize((16, 16))
        
        bitmap = rTool.Disk.Bitmap
        self.save = t.Tool(self, bitmap, rPost.save.label, rPost.save.help)
        self.save.disable()
        
        bitmap = rTool.CrossScript.Bitmap
        self.delete = t.Tool(self, bitmap, rPost.delete.label,
                             rPost.delete.help)
        self.delete.disable()
        
        bitmap = rTool.WeatherCloud.Bitmap
        self.queue = t.Tool(self, bitmap, rPost.queue.label, rPost.queue.help)
        self.queue.disable()
        
        bitmap = rTool.Drive.Bitmap
        self.download = t.Tool(self, bitmap, rPost.download.label,
                               rPost.download.help)
        self.download.disable()
        
        bitmap = rTool.ImageExport.Bitmap
        self.export = t.Tool(self, bitmap, rPost.export.label,
                             rPost.export.help)
        self.export.disable()
        
        self.AddSeparator()
        
        bitmap = rTool.ArrowInOut.Bitmap
        self.toggleSplit = t.Tool(self, bitmap, rFile.toggleSplit.label,
                                  rFile.toggleSplit.help)
        
        bitmap = rTool.ApplicationSplitTile.Bitmap
        label = rFile.orientSplit.label
        help = rFile.orientSplit.help
        self.orientSplit = t.Tool(self, bitmap, label, help)
        
        self.AddSeparator()
        
        self.about = t.Tool(self, rTool.About.Bitmap, rHelp.about.label,
                            rHelp.about.help)
        
        self.AddSeparator()
        
        self.close = t.Tool(self, rTool.DoorOpenOut.Bitmap, rFile.quit.label,
                            rFile.quit.help)
        
        self.AddStretchableSpace()
        
        self.filter = wx.SearchCtrl(self, style=wx.TE_PROCESS_ENTER,
                                    size=(200, -1))
        self.filter.ShowCancelButton(True)
        self.AddControl(self.filter)
        